package com.liao.badminton.vo;

import cn.hutool.core.collection.CollectionUtil;
import com.liao.badminton.code.BaseField;
import io.swagger.annotations.ApiModelProperty;
import java.lang.String;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import lombok.Data;
import com.liao.badminton.entity.SystemUsers;
/**
* @author liaocheng
* @date 2024-11-01
* description:用户信息表
*/
@Data
public class SystemUsersVo  extends BaseField {

    @ApiModelProperty(value = "用户ID")
    private Long id;

    @ApiModelProperty(value = "用户账号")
    private String username;
    @ApiModelProperty(value = "用户分享码")
    private String userCode;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "用户昵称")
    private String nickname;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    @ApiModelProperty(value = "岗位编号数组")
    private String postIds;

    @ApiModelProperty(value = "用户邮箱")
    private String email;

    @ApiModelProperty(value = "手机号码")
    private String mobile;

    @ApiModelProperty(value = "用户性别")
    private Integer sex;

    @ApiModelProperty(value = "头像地址")
    private String avatar;

    @ApiModelProperty(value = "帐号状态（0正常 1停用）")
    private Integer status;

    @ApiModelProperty(value = "最后登录IP")
    private String loginIp;

    @ApiModelProperty(value = "最后登录时间")
    private Date loginDate;

    @ApiModelProperty(value = "用户类型（0系统用户 1普通用户）")
    private Integer userType;

    @ApiModelProperty(value = "默认登录群组ID")
    private Long defaultGroupId;
    @ApiModelProperty(value = "默认登录群组名称")
    private String defaultGroupName;
    @ApiModelProperty(value = "默认登录群用户昵称名称")
    private String defaultGroupUserName;

    @ApiModelProperty(value = "群信息")
    private List<BadmintonGroupVo>  groupList = CollectionUtil.newArrayList();

    public static SystemUsersVo invertToVo(SystemUsers systemUsers){
        SystemUsersVo vo = new SystemUsersVo();
        BaseField.invert(systemUsers, vo);
        vo.setId(systemUsers.getId());
        vo.setUsername(systemUsers.getUsername());
        vo.setUserCode(systemUsers.getUserCode());
        vo.setPassword(systemUsers.getPassword());
        vo.setNickname(systemUsers.getNickname());
        vo.setRemark(systemUsers.getRemark());
        vo.setDeptId(systemUsers.getDeptId());
        vo.setPostIds(systemUsers.getPostIds());
        vo.setEmail(systemUsers.getEmail());
        vo.setMobile(systemUsers.getMobile());
        vo.setSex(systemUsers.getSex());
        vo.setAvatar(systemUsers.getAvatar());
        vo.setStatus(systemUsers.getStatus());
        vo.setLoginIp(systemUsers.getLoginIp());
        vo.setLoginDate(systemUsers.getLoginDate());
        vo.setUserType(systemUsers.getUserType());
        return vo;
    }
}
